Component({
  mixins: [],
  data: {},
  props: {
    couponList: []
  },
  didMount() { },
  didUpdate() { },
  didUnmount() { },
  methods: {
    async getCoupon(e) {
      const { cloud } = getApp();
      let activity_url = e.currentTarget.dataset.activity_url;
      const res = await cloud.application.httpRequest({
        path: '/index.php/index/tb/getCoupon',
        method: 'GET',
        params: {
          shop_id: getApp().globalData.shop_id
        }
      });
      if (res == '领取成功') {
        my.alert({
          content: '已获取领取链接，去浏览器粘贴即可领取',
          success: (res2) => {
            my.setClipboard({
              text: activity_url
            });
          }
        })
      }
      else {
        my.alert({
          content: res
        })
      }
    },
  },
});
